#coding:utf-8
import requests
import sys
import re
import urllib
import urllib2
reload(sys)
sys.setdefaultencoding('utf-8')

url = 'http://zkcj.xyzsb.net/selectzhongxueluqu_1.asp'
headers = {"Content-Type":"application/x-www-form-urlencoded"}
# headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36'}

data = {'xxcode':'199908','bkh':'15098300160453'}

# r = requests.get(url, data=data, headers=headers)
# r = requests.get(url, data=data)

# tab = r.text
# print tab

test_data_urlencode = urllib.urlencode(data)
req = urllib2.Request(url = url,data =test_data_urlencode)
print req
res_data = urllib2.urlopen(req)
res = res_data.read()
print res


# with open('t.html', 'w') as fd:
#     fd.write(tab)

# f = open('t.html','r')
# tab = f.read()
# print tab

# msg = re.compile('''<font color='#000000'>([\s\S]*?)</font>''')
# mmm = msg.findall(tab)

# print mmm[0] +": "+ mmm[3]
# print mmm[1] +": "+ mmm[4]
# print mmm[2] +": "+ mmm[5].split('&')[0]


# for each in mmm:
#     print each


# 您的录取情况如下
# msg = re.compile('<b>(.*)</b>')
# mmm = msg.findall(tab)
# print mmm[0]

